<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ViewMap.ascx.cs" Inherits="cwcare.Modules.cwcareXML.ViewMap" %>
<script type="text/javascript" src="Resources/Shared/scripts/map/jquery.min.js"></script>
<script type="text/javascript" src="Resources/Shared/scripts/map/jquery.maphilight.js"?ts=<%=DateTime.Now.ToString("MMddyyyyhhmmss")%>></script>
<script type="text/javascript" src="Resources/Shared/scripts/map/jquery.metadata.min.js"></script>
<script type="text/javascript">
    $(function () {
        $('.map').maphilight();

        $('area').live('click', function (event) {
            var state = $(event.currentTarget).attr('state');
            $('#<%=hfLattitude.ClientID %>').val(state);
            __doPostBack('<%= lkbViewMap.UniqueID %>', '');
        });

        $('.CityLink').live('click', function (event) {
            var city = $(event.currentTarget).html();
            $('#<%=hfCity.ClientID %>').val(city.trim());
            __doPostBack('<%= btnViewCity.UniqueID %>', '');
        });
    });
</script>
<style type="text/css">
    a.CityLink
    {
        color: #00A4E4;
        text-decoration: none;
        cursor: pointer;
    }
    a.CityLink:visited
    {
        text-decoration: none;
        color: #00A4E4;
    }
    
    a.CityLink:hover
    {
        text-decoration: none;
        color: #f00;
    }
</style>
<div id="leftc">
    <asp:MultiView runat="server" ID="mltView" ActiveViewIndex="0">
        <asp:View runat="server" ID="vMap">
            <h3 class="mainhead">
                Our Locations</h3>
            <p>
                Capital Women's Care is available in the below states. Please click on available
                states to nagivate to exact location for your seeking.</p>
            <img src="Resources/Shared/images/usa-map.jpg" border="0" class="map" usemap="#simple"  />
            <asp:Repeater runat="server" ID="rpMaps" EnableViewState="false">
                <HeaderTemplate>
                    <map name="simple" id="simple" onclick="return false;">
                </HeaderTemplate>
                <FooterTemplate>
                    </map></FooterTemplate>
                <ItemTemplate>
                    <area shape="poly" coords="<%# Eval("StateCordinate") %>" alt="<%# Eval("StateName") %>"
                        <%# SetStateClass(Eval("StateClassId"))%> title="<%# Eval("StateName") %>" href="#"
                        state="<%# Eval("StateCode") %>" />
                </ItemTemplate>
            </asp:Repeater>
            <asp:HiddenField runat="server" ID="hfLattitude" />
            <asp:LinkButton runat="server" ID="lkbViewMap" OnClick="btViewMap_Click"></asp:LinkButton>
        </asp:View>
        <asp:View runat="server" ID="vDetail">
            <h3 class="mainhead">
                Our Locations</h3>
            <p>
                Capital Women's Care has offices throughout the DC Metro area. Please <a href="/locateprovider.aspx">
                    click here</a> to locate the one most convenient for you.</p>
            <h3>
                List cities in <b>
                    <%=stateName%></b> state:</h3>
            <div style="width: 500px">
                <asp:Repeater ID="rplocations" runat="server">
                    <ItemTemplate>
                        <div style="width: 130px; float: left; margin: 5px 10px 0px 0px">
                            <a class="CityLink">
                                <%# Eval("city") %></a>
                        </div>
                    </ItemTemplate>
                </asp:Repeater>
            </div>
            <img src="Resources/Shared/images/<%=state %>.gif" border="0" width="500px" /></div>
<asp:HiddenField runat="server" ID="hfCity" />
<asp:LinkButton runat="server" ID="btnViewCity" OnClick="btnViewCity_Click"></asp:LinkButton>
</asp:View>
<asp:View runat="server" ID="vShowMap">
    <h3 class="mainhead">
        Our Locations</h3>
    <p>
        Capital Women's Care has offices throughout the DC Metro area. Please <a href="/locateprovider.aspx">
            click here</a> to locate the one most convenient for you.</p>
    <asp:Table ID="Table1" border="0" CellPadding="5" CellSpacing="0" runat="server" Width="580px">
        <asp:TableRow ID="Tablerow2" runat="server">
            <asp:TableCell ID="Tablecell1" runat="server">
                <asp:Repeater ID="rpAddress" runat="server">
                    <HeaderTemplate>
                        <h3>
                            List providers in <b>
                                <%=city %></b> city.</h3>
                        <table cellpadding="5" cellspacing="0">
                            <tr>
                                <td>
                                    <b>Provider Name</b>
                                </td>
                                <td>
                                    <b>Address</b>
                                </td>
                                <td>
                                    <b>Telephone</b>
                                </td>
                            </tr>
                    </HeaderTemplate>
                    <ItemTemplate>
                        <tr>
                            <td>
                                <a class="CityLink" href ="../../../Provider.aspx?pid=<%# Eval("providerID")%>"><%# Eval("providerName")%> </a>
                            </td>
                            <td>
                                <%# Eval("address")%>
                            </td>
                            <td>
                                <%# Eval("phone")%>
                            </td>
                        </tr>
                    </ItemTemplate>
                    <FooterTemplate>
                        </table>
                    </FooterTemplate>
                </asp:Repeater>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <iframe src="/DesktopModules/cwcareXML/GoogleMap/MarkerXmlSearcher.html?lattitude=<%=lattitude %>&longitude=<%=longitude %>&city=<%=city%>"
        style="border: none; width: 550px; height: 720px; margin: 0 0 0 5px"></iframe>
</asp:View>
</asp:MultiView> </div> 